package com.wanmait.recruitment.service.impl;

import com.github.pagehelper.PageInfo;
import com.wanmait.recruitment.mapper.PoliticalStatusMapper;
import com.wanmait.recruitment.pojo.PoliticalStatus;
import com.wanmait.recruitment.service.PoliticalStatusService;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class PoliticalStatusServiceImpl implements PoliticalStatusService {

    @Resource
    private PoliticalStatusMapper politicalStatusMapper;
    @Override
    @CacheEvict(value = "politicalStatusCache",allEntries = true)
    public void insert(PoliticalStatus object) {
        politicalStatusMapper.insertSelective(object);
}

    @Override
    @CacheEvict(value = "politicalStatusCache",allEntries = true)
    public void delete(Integer id) {
        politicalStatusMapper.updateByPrimaryKey(id);
    }

    @Override
    public void delete(String ids) {

    }

    @Override
    @CacheEvict(value = "politicalStatusCache",allEntries = true)
    public void update(PoliticalStatus object) {
        politicalStatusMapper.updateByPrimaryKeySelective(object);
    }

    @Override
    public PoliticalStatus findById(Integer id) {
        return null;
    }

    @Override
    @Cacheable("politicalStatusCache")
    public List<PoliticalStatus> findAll() {
        return politicalStatusMapper.selectFindAll();
    }

    @Override
    public List<PoliticalStatus> findAll(PoliticalStatus object) {
        return null;
    }

    @Override
    public PageInfo<PoliticalStatus> findPage(int pageNum, int pageSize) {
        return null;
    }
}
